package cn.dmp.utils

/**
  * 将字符串数据转换成Int或者Double格式
  */
object NumberFormat {
  def toInt(str: String): Int = {
    try{
      str.toInt
    } catch {
      case _: Exception => 0
    }
  }

  def toDouble(str: String): Double = {
    try{
      str.toDouble
    } catch {
      case _: Exception => 0
    }
  }


}
